package gui;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;


/*
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/

/**
 * Créer un dialogue "A propos de" donnant des informations générales sur le programme
 * 
 * @author			Christos Kornaros, Grégory Moinat, Nicolas Muller
 * @version			1.0, 02.04.2008
 * Fichier :		JAboutBox.java
 * Remarque(s) :	Une partie du code a été généré par Jigloo, utilitaire pour créer
 			  		des interfaces graphiques Swing (cf commentaire ci-dessus).
 * Compilateur : 	jdk1.6.0_02
*/ 
public class JAboutBox extends javax.swing.JDialog {

	private static final long serialVersionUID = 1L;
	private JLabel lblName;
	private JLabel lblVersion;
	private JLabel lblDescrition;
	private JButton cmdClose;
	private JLabel lblLogo;
	private JLabel lblAuthorsNames;
	private JLabel lblVersionNumber;
	private JLabel lblAuthors;


	/**
	 * Constructeur: Crée la fenêtre
	 * @param frame La fenêtre à laquelle appartient ce dialogue
	 */
	public JAboutBox(JFrame frame) {
		super(frame);
		initGUI();
		setLocation(frame.getLocation().x + 70, frame.getLocation().y + 70);
	}
	
	
	/**
	 * Code autogénéré par Jigloo
	 */
	private void initGUI() {
		try {
			{
				GridBagLayout thisLayout = new GridBagLayout();
				thisLayout.rowWeights = new double[] {0.0, 0.1, 0.0, 0.1, 0.1, 0.1};
				thisLayout.rowHeights = new int[] {31, 7, 60, 7, 7, 20};
				thisLayout.columnWeights = new double[] {0.0, 0.0, 0.1, 0.1};
				thisLayout.columnWidths = new int[] {172, 84, 7, 7};
				getContentPane().setLayout(thisLayout);
				this.setTitle("A propos de C.O.D.E.");
				this.setModal(true);
				this.setResizable(false);
				{
					lblName = new JLabel();
					getContentPane().add(lblName, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
					lblName.setText("C.O.D.E. is An Open Developpment Editor");
					lblName.setFont(new java.awt.Font("Dialog",1,16));
				}
				{
					lblVersion = new JLabel();
					getContentPane().add(lblVersion, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					lblVersion.setText("Version");
					lblVersion.setFont(new java.awt.Font("Dialog",1,12));
				}
				{
					lblAuthors = new JLabel();
					getContentPane().add(lblAuthors, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					lblAuthors.setText("Auteurs");
					lblAuthors.setFont(new java.awt.Font("Dialog",1,12));
				}
				{
					lblVersionNumber = new JLabel();
					getContentPane().add(lblVersionNumber, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
					lblVersionNumber.setText("1.0");
				}
				{
					lblAuthorsNames = new JLabel();
					getContentPane().add(lblAuthorsNames, new GridBagConstraints(2, 2, 2, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 0), 0, 0));
					lblAuthorsNames.setText("<html>Christos Kornaros<BR>Grégory Moinat<BR>Nicolas Muller");
				}
				{
					lblLogo = new JLabel();
					getContentPane().add(lblLogo, new GridBagConstraints(0, 1, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					lblLogo.setIcon(new ImageIcon(getClass().getClassLoader().getResource("ressources/aboutbox/heigvd.png")));
				}
				{
					lblDescrition = new JLabel();
					getContentPane().add(lblDescrition, new GridBagConstraints(0, 4, 4, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 10, 0, 0), 0, 0));
					lblDescrition.setText("<html>C.O.D.E. a été développé lors d'un projet de semestre à la <BR>Haute Ecole d'Ingénierie et de Gestion du Canton de Vaud<BR>Yverdon-les-Bains, Suisse, 2008.</html>");
				}
				{
					cmdClose = new JButton();
					getContentPane().add(cmdClose, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
					cmdClose.setText("Fermer");
					cmdClose.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent evt) {
							JAboutBox.this.setVisible(false);
						}
					});
				}
			}
			this.setSize(468, 205);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
